package cz.rosada.sx.library;

public class Field {

	public String mName;

	public enum FieldType {
		// VARCHAR, NVARCHAR, TEXT, INTEGER, FLOAT, ABOOLEAN, CLOB, BLOB,
		// TIMESTAMP, NUMERIC, VARYING_CHARACTER, NATIONAL_VARYING_CHARACTER
		INTEGER, REAL, TEXT, BLOB
	}

	public FieldType mType;

	public boolean mPrimaryKey;

	public Field(final String name, final FieldType type,
			final boolean primaryKey) { 
		mName = name;
		mType = type;
		mPrimaryKey = primaryKey;
	}

	public String toSQL() {
		StringBuilder result = new StringBuilder();

		result.append(mName + Char.SPACE + mType);

//		if (mPrivateKey) {
//			result.append(Char.SPACE + "PRIMARY KEY");
//		}

		return result.toString();
	}
}
